#ifndef _MY_PLAYER_H_
#define _MY_PLAYER_H_
#include "cocos2d.h"
#include "myobject.h"

using namespace cocos2d;

namespace fireplane
{
	class Gun;

	class Player : public Object
	{
	public:
		Player();
		~Player();

		static Player* getMainPlayer();

		CCNode* getPlayerParent();
		CCPoint getPlayerPos();
		void init(CCPoint pos);
		void update(float dt);

		void beginTouch(CCPoint worldPos);
		void moveTouch(CCPoint worldPos);
		void endTouch(CCPoint worldPos);
		void _do_fire_logic(float dt);
		void _do_move_logic(float dt);

		CCRect getPlayerWorldCollisionSize();
	private:
		CCSprite* _body;
		float _fireDelay;
		Gun* _gun;

		CCPoint _despos;
		CCPoint _dir;
		float _speed;
		bool _need_move;
	};

}

#endif